package controller

import (
	"agent-list---web-development/list/common"
	"agent-list---web-development/list/dto"
	"agent-list---web-development/list/model"
	"github.com/gin-gonic/gin"
	"net/http"
)

func Info(c *gin.Context) {
	acc, _ := c.Get("account")
	DB := common.DB
	var user model.User
	DB.Where("account=?", acc).First(&user)
	c.JSON(http.StatusOK, gin.H{"code": 200, "data": gin.H{"username": dto.ToUserDto(user)}})
}
